package com.bdqn.ch08.pojo;

import org.junit.Before;
import org.junit.Test;
import redis.clients.jedis.Jedis;

public class JedisTester {
    private Jedis jedis;

    @Before
    public void setup(){
        jedis = new Jedis("127.0.0.1" , 6379);
        jedis.auth("oobared");
    }

    @Test
    public void testString(){
        jedis.set("name"  , "ktjiaoyu");
        System.out.println(jedis.get("name"));

        jedis.append("name" , "czkt");
        System.out.println(jedis.get("name"));

        jedis.mset("name" , "ktjiaoyu" , "age" , "17" , "add" , "cz");
        jedis.incr("age");
        System.out.println(jedis.get("name")+"-"+jedis.get("age")+"-"+jedis.get("add"));
    }
}
